package com.ourchem.bus.conf;

import com.ourchem.bus.service.NacosDataTokenService;
import com.ourchem.bus.service.NacosDataTokenService2;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

public class NacosDataFeignConfig2 implements RequestInterceptor {
    private final static Logger logger = LoggerFactory.getLogger(NacosDataFeignConfig2.class);

    @Autowired
    NacosDataTokenService2 nacosDataTokenService2;

    @Override
    public void apply(RequestTemplate template) {
        String token = nacosDataTokenService2.getToken();
        template.header("Authorization", "bearer " + token);
        // logger.info("NacosDataFeignService get token: {}", token);
    }
}
